<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>VUE事件学习</title>
	</head>
	<body>
		<div id="app">
			<h1 v-text="name"></h1>
			<h1 v-text="num"></h1>
			<br />
			<button v-on:click="num++">增加</button>
			<!-- 简化操作 -->
			<button @click="num++">增加</button>
			<!-- vue中调用函数方法 -->
			<button @click="addNum">方法自增</button>
			<button @click="addNum2">方法自增2</button>
		</div>
		<script src="../js/vue.js"></script>		
		<script>
			const app=new Vue({
				el: "#app",
				data:{
					name:"VUE案例",
					num:1,
				},
				methods:{
					addNum: function(){
						this.num++
					},
					addNum2(){
						this.num+=2
					}
				}
			})
		</script>
		
		
	</body>
</html>
